;-------------------------  
;-- Beat Time addon by LBB
;-- http://zap.to/lbb for updates
;-- 
;-- This is the alias that creates a new variable called $beat
;-- To use it, simply paste the alias into your script then place
;-- $beat anywhere you want it to appear. Alternatively you can
;-- just load this entire snippet with /load -rs lbb-beat.mrc
;-------------------------  
alias beat {
return $round($calc((($gmt(HH)*60*60)+($gmt(nn)*60)+$gmt(ss))/86.4),0)
}
;-------------------------  
;-- As an example here I have created an 'on connect' event to 
;-- start a titlebar clock. Feel free to remove/change all that follows.
;-------------------------  
on 1:connect:/titlestart
;-------------------------  
;-- This command simply sets a timer to run each second and call an alias
;-- each time. Also this timer will cease when you disconnect.
;-------------------------  
alias titlestart {
  timer tbar 1 bclock
  }
;-------------------------  
;-- This inserts the current local date and time, followed by the current
;-- Beat time, followed by your nickname.
;-- Remember to have a current time you need to update the time display often,
;-- I prefer once a second.
;-------------------------  
alias bclock {
  set %date $asctime(dd:mmm:yyyy)
  set %time $date(h:nn:sstt)
  titlebar ( $+ %date %time $+ ) ( $+ Beat $+ @ $+ $beat $+ ) ( $+ Current Nick - $me $+ )
}
;-- End
